namespace YM {
    const headPos: number = 50;
    export class IdGenerater {
        private static _appId: number = 0;
        private static head: number = 0;
        static get appId(): number {
            return IdGenerater._appId;
        }
        static set appId(value: number) {
            IdGenerater.appId = value;
            IdGenerater.head = value << headPos;
        }
        static headMask: number = 0x0003ffffffffffff;
        static value: number = 0;
        static instanceId:number=0;
        private static sceneId: number = 100000;
        static generateSceneId(): number {
            return ++IdGenerater.sceneId;
        }
        static generateSceneInstanceId(id: number): number {
            return IdGenerater.head + id;
        }
        static GenerateId(length:number): number {
            return Number(Math.random().toString().substr(3, length) + Date.now());
        }
        static GenerateInstanceId(): number {
            return ++this.instanceId;
        }
        static GetProcessId(v:number):number
        {
            return v >> headPos;
        }
    }
}